package sctu.edu.java.year2016.team04.luoxinghua.lianxi.sandam;

/**
 * Created by 落叶的思恋 on 2016/5/20.
 */
public class zhongduan {
    public static void main(String[] args) {
        System.out.println("\n-------------中断循环的列子--------");
       int eaglenumbe=0;
        System.out.println("开始抓贪官");
        String[] array=new String[]{"工人","护士","医生","老师","保安","公务员","工人","护士","医生","老师"
                ,"保安","公务员","工人","护士","医生","老师","保安","公务员"};
        for(String string:array){
            if(string.equals("公务员")){
                System.out.println("抓到一个公务员。打死");
                  eaglenumbe++;
            continue;
        }
        System.out.println("继续查找下一个  "+string);
    }
        System.out.println("总共多少贪官  "+eaglenumbe);
    }
}
